#Include <ScreenCapture.au3>
#Include <File.au3>
#Include <Function For Scan.au3>
#Include <GuiListView.au3>

Common_WriteCurrentFunctionNameToTempTXT($sScanFunctionName)

Scan2_4_1()
Scan2_4_2()
Scan2_4_3()
Scan2_4_4()
Scan2_4_5()
Scan2_4_7()
Scan2_4_8()
Scan2_4_9()
Scan2_4_10()
Scan2_4_11()
Scan2_4_12()
Scan2_4_13()
Scan2_5_1()
Scan2_5_2()
Scan2_5_3()
Scan2_5_4()
Scan2_5_5()
Scan2_5_6()
Scan2_5_7()
Scan2_6_3()
Scan2_6_4()
Scan2_6_6()
Scan2_6_7()
Scan2_6_8()
Scan2_6_9()
Scan2_6_10()
Scan2_6_13()
Scan2_6_23()
Scan2_6_24()
Scan2_6_26()
Scan2_6_27()
Scan2_6_28()
Scan2_6_29()
Scan2_6_30()
Scan2_6_31()

CloseOpenedExcel($oExcel)

Func Scan2_4_1()
	Local $TestCaseID = "2.4.1", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('TestTestTestTestTest', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickScanButtonInToolBar($hPMHandle, $ScanButtonInToolbar, $TestCaseID, $sScanFunctionName) Then Return False
	If Not WaitScanFinished($sScanningProgressBarDlgTitle,30, $TestCaseID, $sScanFunctionName) Then Return False
	If FileExists($PMFolder & 'TestTestTestTestTest0001.jpg') Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $MunalExecuteTestCase, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_4_2()
	Local $TestCaseID = "2.4.2", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('test.jpg', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not Common_ScreenCaprureWindow_Ex($sPerformResultPath,$sCaptureImage, $ScanSettingsdialog, 'Please change prefix because',$TestCaseID, $sScanFunctionName)Then Return False
	For $i = 0 to 1
		Send("{ESC}")  ;CLose Scan settting dialog.
	Next
	If Common_CompareFile($sPerformResultPath & $sCaptureImage, $sCorrectResultPath & $sCaptureImage) Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $CompareScreenCapture, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_4_3()
	Local $TestCaseID = "2.4.3", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('!@3457=+{}][', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickScanButtonInToolBar($hPMHandle, $ScanButtonInToolbar, $TestCaseID, $sScanFunctionName) Then Return False
	If Not WaitScanFinished($sScanningProgressBarDlgTitle,30, $TestCaseID, $sScanFunctionName) Then Return False
	If FileExists($PMFolder & '!@3457=+{}][0001.jpg') Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $MunalExecuteTestCase, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_4_4()
	Local $TestCaseID = "2.4.4", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not Common_ScreenCaprureWindow_Ex($sPerformResultPath,$sCaptureImage, $ScanSettingsdialog, 'You must type a name.',$TestCaseID, $sScanFunctionName)Then Return False
	For $i = 0 to 1
		Send("{ESC}")  ;CLose Scan settting dialog.
	Next
	If Common_CompareFile($sPerformResultPath & $sCaptureImage, $sCorrectResultPath & $sCaptureImage) Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $CompareScreenCapture, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_4_5()
	Local $TestCaseID = "2.4.5", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('     Test', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickScanButtonInToolBar($hPMHandle, $ScanButtonInToolbar, $TestCaseID, $sScanFunctionName) Then Return False
	If Not WaitScanFinished($sScanningProgressBarDlgTitle,30, $TestCaseID, $sScanFunctionName) Then Return False
	If FileExists($PMFolder & 'Test0001.jpg') Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $MunalExecuteTestCase, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_4_7()
	Local $TestCaseID = "2.4.7", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('Scan0001', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickScanButtonInToolBar($hPMHandle, $ScanButtonInToolbar, $TestCaseID, $sScanFunctionName) Then Return False
	If Not WaitScanFinished($sScanningProgressBarDlgTitle,30, $TestCaseID, $sScanFunctionName) Then Return False
	If FileExists($PMFolder & 'Scan00010001.jpg') Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $MunalExecuteTestCase, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_4_8()
	Local $TestCaseID = "2.4.8", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('Scan0001', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickScanButtonInToolBar($hPMHandle, $ScanButtonInToolbar, $TestCaseID, $sScanFunctionName) Then Return False
	If Not WaitScanFinished($sScanningProgressBarDlgTitle,30, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickScanButtonInToolBar($hPMHandle, $ScanButtonInToolbar, $TestCaseID, $sScanFunctionName) Then Return False
	If Not WaitScanFinished($sScanningProgressBarDlgTitle,30, $TestCaseID, $sScanFunctionName) Then Return False
	If FileExists($PMFolder & 'Scan00010002.jpg') Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $MunalExecuteTestCase, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_4_9()
	Local $TestCaseID = "2.4.9", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not CopyFile($sSampleFolderPath & 'Scan00010001.jpg', $PMFolder, $TestCaseID, $sScanFunctionName) Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('Scan0001', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickScanButtonInToolBar($hPMHandle, $ScanButtonInToolbar, $TestCaseID, $sScanFunctionName) Then Return False
	If Not WaitScanFinished($sScanningProgressBarDlgTitle,30, $TestCaseID, $sScanFunctionName) Then Return False
	If FileExists($PMFolder & 'Scan00010002.jpg') Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $MunalExecuteTestCase, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_4_10()
	Local $TestCaseID = "2.4.10", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not CopyFile($sSampleFolderPath & 'Scan00010001.jpg', $PMFolder, $TestCaseID, $sScanFunctionName) Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('Scan0001', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not DeleteFile($PMFolder & 'Scan00010001.jpg', $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickScanButtonInToolBar($hPMHandle, $ScanButtonInToolbar, $TestCaseID, $sScanFunctionName) Then Return False
	If Not WaitScanFinished($sScanningProgressBarDlgTitle,30, $TestCaseID, $sScanFunctionName) Then Return False
	If FileExists($PMFolder & 'Scan00010001.jpg') Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $MunalExecuteTestCase, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc
	
Func Scan2_4_11()
	Local $TestCaseID = "2.4.11", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Uncheck', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('Scan0001', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickScanButtonInToolBar($hPMHandle, $ScanButtonInToolbar, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickScanButtonOnScnnerShowUI($sScannerShowUIDlg, $iScannerShowUIScanButtonID ,$TestCaseID, $sScanFunctionName) Then Return False
	If Not WaitScanFinished($sScanningProgressBarDlgTitle,30, $TestCaseID, $sScanFunctionName) Then Return False
	If FileExists($PMFolder & 'Scan00010001.jpg') Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $MunalExecuteTestCase, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_4_12()
	Local $TestCaseID = "2.4.12", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Uncheck', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('Scan0001', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	For $i = 0 to 1
		If Not ClickScanButtonInToolBar($hPMHandle, $ScanButtonInToolbar, $TestCaseID, $sScanFunctionName) Then Return False
		If Not ClickScanButtonOnScnnerShowUI($sScannerShowUIDlg, $iScannerShowUIScanButtonID ,$TestCaseID, $sScanFunctionName) Then Return False
		If Not WaitScanFinished($sScanningProgressBarDlgTitle,30, $TestCaseID, $sScanFunctionName) Then Return False
	Next
	If FileExists($PMFolder & 'Scan00010002.jpg') Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $MunalExecuteTestCase, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_4_13()
	Local $TestCaseID = "2.4.13", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Uncheck', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('Scan0001', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickScanButtonInToolBar($hPMHandle, $ScanButtonInToolbar, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickScanButtonOnScnnerShowUI($sScannerShowUIDlg, $iScannerShowUIScanButtonID ,$TestCaseID, $sScanFunctionName) Then Return False
	If Not WaitScanFinished($sScanningProgressBarDlgTitle,30, $TestCaseID, $sScanFunctionName) Then Return False
	If Not Common_DeleteFile($PMFolder & 'Scan00010001.jpg', $TestCaseID, $sScanFunctionName) Then Return False	
	If Not ClickScanButtonInToolBar($hPMHandle, $ScanButtonInToolbar, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickScanButtonOnScnnerShowUI($sScannerShowUIDlg, $iScannerShowUIScanButtonID ,$TestCaseID, $sScanFunctionName) Then Return False
	If Not WaitScanFinished($sScanningProgressBarDlgTitle,30, $TestCaseID, $sScanFunctionName) Then Return False
	If FileExists($PMFolder & 'Scan00010001.jpg') Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $MunalExecuteTestCase, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_5_1()
	Local $TestCaseID = "2.5.1", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Uncheck', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('2_5_1', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Scan to My Pagemanager Folder', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickScanButtonInToolBar($hPMHandle, $ScanButtonInToolbar, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickScanButtonOnScnnerShowUI($sScannerShowUIDlg, $iScannerShowUIScanButtonID ,$TestCaseID, $sScanFunctionName) Then Return False
	If Not WaitScanFinished($sScanningProgressBarDlgTitle,30, $TestCaseID, $sScanFunctionName) Then Return False
	If FileExists($PMFolder & '2_5_10001.jpg') Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $MunalExecuteTestCase, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_5_2()
	Local $TestCaseID = "2.5.2", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Uncheck', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('2_5_2', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Scan to My Pagemanager Folder', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickScanButtonInToolBar($hPMHandle, $ScanButtonInToolbar, $TestCaseID, $sScanFunctionName) Then Return False
	DirRemove($PMFolder, 1)
	If Not ClickScanButtonOnScnnerShowUI($sScannerShowUIDlg, $iScannerShowUIScanButtonID ,$TestCaseID, $sScanFunctionName) Then Return False
	If Not WaitScanFinished($sScanningProgressBarDlgTitle,30, $TestCaseID, $sScanFunctionName) Then Return False
	If FileExists($PMFolder & '2_5_20001.jpg') Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $MunalExecuteTestCase, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_5_3()
	Local $TestCaseID = "2.5.3", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('2_5_3', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Scan to My Pagemanager Folder', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickScanButtonInToolBar($hPMHandle, $ScanButtonInToolbar, $TestCaseID, $sScanFunctionName) Then Return False
	If Not WaitScanFinished($sScanningProgressBarDlgTitle,30, $TestCaseID, $sScanFunctionName) Then Return False
	If FileExists($PMFolder & '2_5_30001.jpg') Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $MunalExecuteTestCase, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_5_4()
	Local $TestCaseID = "2.5.4", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('2_5_4', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Scan to My Pagemanager Folder', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	DirRemove($PMFolder, 1)
	If Not ClickScanButtonInToolBar($hPMHandle, $ScanButtonInToolbar, $TestCaseID, $sScanFunctionName) Then Return False
	If Not WaitScanFinished($sScanningProgressBarDlgTitle,30, $TestCaseID, $sScanFunctionName) Then Return False
	If FileExists($PMFolder & '2_5_40001.jpg') Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $MunalExecuteTestCase, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_5_5()
	Local $TestCaseID = "2.5.5", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('2_5_5', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Scan to Active Folder', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickScanButtonInToolBar($hPMHandle, $ScanButtonInToolbar, $TestCaseID, $sScanFunctionName) Then Return False
	If Not WaitScanFinished($sScanningProgressBarDlgTitle,30, $TestCaseID, $sScanFunctionName) Then Return False
	If FileExists($PMFolder & '2_5_50001.jpg') Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $MunalExecuteTestCase, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_5_6()
	Local $TestCaseID = "2.5.6", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not SelectDoubleByteFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('2_5_6', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Scan to Active Folder', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickScanButtonInToolBar($hPMHandle, $ScanButtonInToolbar, $TestCaseID, $sScanFunctionName) Then Return False
	If Not WaitScanFinished($sScanningProgressBarDlgTitle,30, $TestCaseID, $sScanFunctionName) Then Return False
	If Not Common_ScreenCaprureWindow_Ex($sPerformResultPath,$sCaptureImage, 'Presto! PageManager', 'The destination folder',$TestCaseID, $sScanFunctionName)Then Return False
	ControlClick('Presto! PageManager', 'The destination folder', 7)   ;CLose the pop up dialog.
	If Common_CompareFile($sPerformResultPath & $sCaptureImage, $sCorrectResultPath & $sCaptureImage) Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $CompareScreenCapture, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_5_7()
	Local $TestCaseID = "2.5.7", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	DirCreate($sFilePatch & $sLongFolderName)
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not SelectLongFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('2_5_7', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Scan to Active Folder', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickScanButtonInToolBar($hPMHandle, $ScanButtonInToolbar, $TestCaseID, $sScanFunctionName) Then Return False
	If Not WaitScanFinished($sScanningProgressBarDlgTitle,30, $TestCaseID, $sScanFunctionName) Then Return False
	If Not Common_ScreenCaprureWindow_Ex($sPerformResultPath,$sCaptureImage, 'Presto! PageManager', 'The destination folder',$TestCaseID, $sScanFunctionName)Then Return False
	ControlClick('Presto! PageManager', 'The destination folder', 7)   ;CLose the pop up dialog.
	If Common_CompareFile($sPerformResultPath & $sCaptureImage, $sCorrectResultPath & $sCaptureImage) Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $CompareScreenCapture, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_6_3()
	Local $TestCaseID = "2.6.3", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('2_6_3', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Scan to Active Folder', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Save Settings', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SaveScanSettings($sPerformResultPath & '$%$%+[]+[]_2_6_3', $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Common_CompareFile($sPerformResultPath & '$%$%+[]+[]_2_6_3' & $sProfileExetension, $sCorrectResultPath & '$%$%+[]+[]_2_6_3' & $sProfileExetension) Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $sChrckSavedScanProfile, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_6_4()
	Local $TestCaseID = "2.6.4", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('2_6_4', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Scan to Active Folder', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Save Settings', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SaveScanSettings('<>/|*', $TestCaseID, $sScanFunctionName) Then Return False
	If Not Common_ScreenCaprureWindow_Ex($sPerformResultPath, $sCaptureImage, 'Save As', 'OK',$TestCaseID, $sScanFunctionName)Then Return False
	ControlClick('Save As', 'OK', 'Button1')   ;CLose alert message	
	Send('{ESC}')  ;Close  save as dialog
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Common_CompareFile($sPerformResultPath & $sCaptureImage, $sCorrectResultPath & $sCaptureImage) Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $CompareScreenCapture, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_6_6()
	Local $TestCaseID = "2.6.6", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('2_6_6', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Scan to Active Folder', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Save Settings', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SaveScanSettings($sPerformResultPath & '2_ 6 _6', $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Common_CompareFile($sPerformResultPath & '2_ 6 _6' & $sProfileExetension , $sCorrectResultPath & '2_ 6 _6' & $sProfileExetension) Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $sChrckSavedScanProfile, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_6_7()
	Local $TestCaseID = "2.6.7", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('2_6_7', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Scan to Active Folder', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Save Settings', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SaveScanSettings($sPerformResultPath & '2_6_7  ', $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Common_CompareFile($sPerformResultPath & '2_6_7' & $sProfileExetension , $sCorrectResultPath & '2_6_7' & $sProfileExetension) Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $sChrckSavedScanProfile, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_6_8()
	Local $TestCaseID = "2.6.8", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('2_6_8', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Scan to Active Folder', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Save Settings', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	Local $sLongestFileName = '2_6_8-aaaa222222222222222aaaaaaaaaa2222222222aaaaaaaaaa2222222222aaaaaaaaaa2222222222aaaaaaaaaa222222aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa111111aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa12aaaaaaaaaaaaaaaaaaaaaaaa'
	If Not SaveScanSettings($sPerformResultPath & $sLongestFileName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not Common_ScreenCaprureWindow_Ex($sPerformResultPath, $sCaptureImage, 'Save As', 'OK',$TestCaseID, $sScanFunctionName)Then Return False
	ControlClick('Save As', 'OK', 'Button1')   ;CLose alert message	
	Send('{ESC}')  ;Close  save as dialog
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Common_CompareFile($sPerformResultPath & $sCaptureImage, $sCorrectResultPath & $sCaptureImage) Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $CompareScreenCapture, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_6_9()
	Local $TestCaseID = "2.6.9", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('2_6_9', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Scan to Active Folder', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Save Settings', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	Local $sLongestFileName = '2_6_9-aaaa22222222222aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa111111aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa12aaaaaaaaaaaaaaaaaaaaaaaa'
	If Not SaveScanSettings($sPerformResultPath & $sLongestFileName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Common_CompareFile($sPerformResultPath & $sLongestFileName & $sProfileExetension , $sCorrectResultPath & '2_6_9' & $sProfileExetension) Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $sChrckSavedScanProfile, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_6_10()
	Local $TestCaseID = "2.6.10", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('2_6_10', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Scan to Active Folder', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Save Settings', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not CopyFile($sSampleFolderPath & 'Sample.ScnPro', $PMFolder, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SaveScanSettings($sSampleFolderPath & 'Sample.ScnPro', $TestCaseID, $sScanFunctionName) Then Return False
	If Not Common_ScreenCaprureWindow_Ex($sPerformResultPath, $sCaptureImage, 'Confirm Save As', '&No',$TestCaseID, $sScanFunctionName)Then Return False
	ControlClick('Confirm Save As', '&No', 'Button2')   ;CLose alert message	
	Send('{ESC}')  ;Close  save as dialog
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Common_CompareFile($sPerformResultPath & $sCaptureImage, $sCorrectResultPath & $sCaptureImage) Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $CompareScreenCapture, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_6_13()
	Local $TestCaseID = "2.6.13", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('2_6_13', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Scan to Active Folder', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Save Settings', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SaveScanSettings($sPerformResultPath & '2_6_13  ', $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Common_CompareFile($sPerformResultPath & '2_6_13' & $sProfileExetension , $sCorrectResultPath & '2_6_13' & $sProfileExetension) Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $sChrckSavedScanProfile, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_6_23()
	Local $TestCaseID = "2.6.23", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('2_6_23', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Scan to Active Folder', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Save Settings', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not CopyFile($sSampleFolderPath & 'Sample.ScnPro', $PMFolder, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SaveScanSettings($sSampleFolderPath & 'Sample.ScnPro', $TestCaseID, $sScanFunctionName) Then Return False
	If Not Common_ScreenCaprureWindow_Ex($sPerformResultPath, $sCaptureImage, 'Confirm Save As', '&No',$TestCaseID, $sScanFunctionName)Then Return False
	ControlClick('Confirm Save As', '&No', 'Button2')   ;CLose alert message	
	Send('{ESC}')  ;Close  save as dialog
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Common_CompareFile($sPerformResultPath & $sCaptureImage, $sCorrectResultPath & $sCaptureImage) Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $CompareScreenCapture, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_6_24()
	Local $TestCaseID = "2.6.24", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('2_6_24', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Scan to Active Folder', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Save Settings', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	Local $sLongestFileName = '2_6_24-aaaa222222222222222aaaaaaaaaa2222222222aaaaaaaaaa2222222222aaaaaaaaaa2222222222aaaaaaaaaa222222aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa111111aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa12aaaaaaaaaaaaaaaaaaaaaaaa'
	If Not SaveScanSettings($sPerformResultPath & $sLongestFileName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not Common_ScreenCaprureWindow_Ex($sPerformResultPath, $sCaptureImage, 'Save As', 'OK',$TestCaseID, $sScanFunctionName)Then Return False
	ControlClick('Save As', 'OK', 'Button1')   ;CLose alert message	
	Send('{ESC}')  ;Close  save as dialog
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Common_CompareFile($sPerformResultPath & $sCaptureImage, $sCorrectResultPath & $sCaptureImage) Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $CompareScreenCapture, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_6_26()
	Local $TestCaseID = "2.6.26", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('2_6_26', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Scan to Active Folder', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Save Settings', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SaveScanSettings($sPerformResultPath & '2_6_26', $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Common_CompareFile($sPerformResultPath & '2_6_26' & $sProfileExetension , $sCorrectResultPath & '2_6_26' & $sProfileExetension) Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $sChrckSavedScanProfile, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_6_27()
	Local $TestCaseID = "2.6.27", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not NonUIScanCheckBoxInScanSettingDlg('Checkin', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SetPrefixValueInScanSettingDlg('2_6_27', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Scan to Active Folder', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Save Settings', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SaveScanSettings($sPerformResultPath & '2_6_27', $TestCaseID, $sScanFunctionName) Then Return False
	If Not ClickButtonInScanSettingDlg('Load Settings', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not LoadScanSettings($sPerformResultPath & '2_6_27.ScnPro', $TestCaseID, $sScanFunctionName) Then Return False
	If Not Common_ScreenCaprureWindow_Ex($sPerformResultPath, $sCaptureImage, $hScanSettingDialog, '',$TestCaseID, $sScanFunctionName)Then Return False	
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Common_CompareFile($sPerformResultPath & $sCaptureImage, $sCorrectResultPath & $sCaptureImage) Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $CompareScreenCapture, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_6_28()
	Local $TestCaseID = "2.6.28", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not ClickButtonInScanSettingDlg('Load Settings', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not LoadScanSettings($sSampleFolderPath & 'Test.ScnPro', $TestCaseID, $sScanFunctionName) Then Return False
	If Not Common_ScreenCaprureWindow_Ex($sPerformResultPath, $sCaptureImage, $hScanSettingDialog, '',$TestCaseID, $sScanFunctionName)Then Return False	
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Common_CompareFile($sPerformResultPath & $sCaptureImage, $sCorrectResultPath & $sCaptureImage) Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $CompareScreenCapture, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_6_29()
	Local $TestCaseID = "2.6.29", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not ClickButtonInScanSettingDlg('Load Settings', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not LoadScanSettings($sSampleFolderPath & $sDoubleByteFileName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not Common_ScreenCaprureWindow_Ex($sPerformResultPath, $sCaptureImage, 'Presto! PageManager', 'Please enter a valid name for the scan profile.',$TestCaseID, $sScanFunctionName)Then Return False	
	Send('{ESC}')   ;Close alert message
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Common_CompareFile($sPerformResultPath & $sCaptureImage, $sCorrectResultPath & $sCaptureImage) Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $CompareScreenCapture, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_6_30()
	Local $TestCaseID = "2.6.30", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not ClickButtonInScanSettingDlg('Load Settings', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not LoadScanSettings($sSampleFolderPath & '$%$%+[]+[].ScnPro', $TestCaseID, $sScanFunctionName) Then Return False
	If Not Common_ScreenCaprureWindow_Ex($sPerformResultPath, $sCaptureImage, $hScanSettingDialog, '',$TestCaseID, $sScanFunctionName)Then Return False	
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Common_CompareFile($sPerformResultPath & $sCaptureImage, $sCorrectResultPath & $sCaptureImage) Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $CompareScreenCapture, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

Func Scan2_6_31()
	Local $TestCaseID = "2.6.31", $sCaptureImage = $TestCaseID & '.jpg', $hPMHandle = '', $hScanSettingDialog = '', $bReproduceTestCase = False  
	If Assign('bReproduceTestCase', Common_ReproduceRunWithIni($sFindFunctionName,$TestCaseID)) And $bReproduceTestCase == False Then Return 3
	If Common_IsTestCaseLevelQualified(Common_GetTestCaseLevel($oExcel, $TestCaseID,$sExcelSheetName,$iCurrentSheetTotalLineNumber)) == False Then Return 2
	Common_Del_DB()
	Common_InitializeStatus()
	InitializeStatusForScan()
	If Assign('hPMHandle', Common_Run_PageManager_Ex($TestCaseID, $sScanFunctionName)) And $hPMHandle == '' Then Return False
	If Not Common_SwitchToFunctionFolder($hPMHandle, $sFolderName, $TestCaseID, $sScanFunctionName) Then Return False
	If Not SelectDriverInSelectSource($sScannerDriverNameInSelectSource,$TestCaseID, $sScanFunctionName) Then Return False
	If Assign('hScanSettingDialog', OpenScanSettingsDialogFromFileMenu($TestCaseID, $sScanFunctionName)) And $hScanSettingDialog == '' Then Return False
	If Not ClickButtonInScanSettingDlg('Load Settings', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Not LoadScanSettings($sSampleFolderPath & 'LongLongLongLongLongLonLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLo.ScnPro', $TestCaseID, $sScanFunctionName) Then Return False
	If Not Common_ScreenCaprureWindow_Ex($sPerformResultPath, $sCaptureImage, $hScanSettingDialog, '',$TestCaseID, $sScanFunctionName)Then Return False	
	If Not ClickButtonInScanSettingDlg('OK', $hScanSettingDialog, $TestCaseID, $sScanFunctionName) Then Return False
	If Common_CompareFile($sPerformResultPath & $sCaptureImage, $sCorrectResultPath & $sCaptureImage) Then
		Common_WriteLog($sPass, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	Else
		Common_WriteLog($sFaile & $CompareScreenCapture, $TestCaseID, $sScanFunctionName, $bReproduceTestCase)
	EndIf
	Common_Close_PM($hPMHandle)
EndFunc

#cs
Func Scan2_6_2()
	Local $testCaseNumber = "2.6.2"   ; The test case number of Thumbnail View STD.
	Common_Del_DB()   ; Delete PM DB.
	ClosePMSBErrorDialog()
	Common_SleepTime(1)
	Local $PMTitle = Common_Run_PageManager()   ; Run PM and get PM title.
	Local $PMHanlde = WinGetHandle($PMTitle)
	ScanSettins($ScanSettingsdialog)
	ScanUIMode($ScanSettingsdialog, "NonUI")
	ScanFrom($ScanSettingsdialog, "Flatbed")
	ScannedFolder($ScanSettingsdialog, "My PageManager")
	SetDocumentType($ScanSettingsdialog, "Magazine (Picture)")	
	SetScanMode($ScanSettingsdialog, "Black and White")
	SetScanSize($ScanSettingsdialog, "A4 210 x 297 mm")
	SetDPI($ScanSettingsdialog, "100  dpi")
	SetSaveAsType($ScanSettingsdialog, "Bitmap(*.bmp)")	
	ScanProfile($ScanSettingsdialog)	
	
	;Empty the file name
	ControlFocus($profile, "", 1152)
	For $i = 0 to 25
		Send("{DEL}")
	Next

	ControlClick("[CLASS:#32770]", "FolderView", "Button2")   ; Click Save button
	Common_SleepTime(4)
	If WinExists("Presto! PageManager", "Please input a name.") Then
		Common_FileWriteLog_1("PASS", $testCaseNumber,$sFileName)
	Else
		Common_FileWriteLog_1("____FAIL,No alert message when set the saved profile name is empty.", $testCaseNumber,$sFileName)
	EndIf
	WinActivate($PMHanlde)   ; Make the focus is on PM.	
	Common_Close_PM()   ; Exit PM.
EndFunc
Func Scan2_6_5()
	Local $testCaseNumber = "2.6.5"   ; The test case number of Thumbnail View STD.
	Common_Del_DB()   ; Delete PM DB.
	ClosePMSBErrorDialog()
	Common_SleepTime(1)
	Local $PMTitle = Common_Run_PageManager()   ; Run PM and get PM title.
	Local $PMHanlde = WinGetHandle($PMTitle)
	ScanSettins($ScanSettingsdialog)
	ScanUIMode($ScanSettingsdialog, "NonUI")
	ScanFrom($ScanSettingsdialog, "Flatbed")
	ScannedFolder($ScanSettingsdialog, "My PageManager")
	SetDocumentType($ScanSettingsdialog, "Magazine (Picture)")	
	SetScanMode($ScanSettingsdialog, "Black and White")
	SetScanSize($ScanSettingsdialog, "A4 210 x 297 mm")
	SetDPI($ScanSettingsdialog, "100  dpi")
	SetSaveAsType($ScanSettingsdialog, "Bitmap(*.bmp)")	
	ScanProfile($ScanSettingsdialog)	
	SetProfileName($profile,"    ")
	ClickSaveButton($profile)
	$text = ControlGetText($profile, "", 65535)
	If $text = '<>/|*' & @lf & 'The above file name is invalid.' Then
		Common_FileWriteLog_1("PASS", $testCaseNumber,$sFileName)
	Else
		Common_FileWriteLog_1("____FAIL,No alert message when set the saved profile name is space." & $text, $testCaseNumber,$sFileName)
	EndIf
	WinActivate($PMHanlde)   ; Make the focus is on PM.	
	Common_Close_PM()   ; Exit PM.
EndFunc
Func Scan2_6_12()
	$file = FileOpen ($DoubleTxt_Path , 0)
	$line = FileReadLine ($file, 1)	
	Local $testCaseNumber = "2.6.12"   ; The test case number of Thumbnail View STD.
	Common_Del_DB()   ; Delete PM DB.
	ClosePMSBErrorDialog()
	Common_SleepTime(1)
	Local $PMTitle = Common_Run_PageManager()   ; Run PM and get PM title.
	Local $PMHanlde = WinGetHandle($PMTitle)
	ScanSettins($ScanSettingsdialog)
	ScanUIMode($ScanSettingsdialog, "NonUI")
	ScanFrom($ScanSettingsdialog, "Flatbed")
	ScannedFolder($ScanSettingsdialog, "My PageManager")
	SetDocumentType($ScanSettingsdialog, "Magazine (Picture)")	
	SetScanMode($ScanSettingsdialog, "Black and White")
	SetScanSize($ScanSettingsdialog, "A4 210 x 297 mm")
	SetDPI($ScanSettingsdialog, "100  dpi")
	SetSaveAsType($ScanSettingsdialog, "Bitmap(*.bmp)")	
	ScanProfile($ScanSettingsdialog)	
	SetProfileName($profile,$sPMFolderPath & $line)
	ClickSaveButton($profile)
	$text = ControlGetText($profile, "", 65535)
	If $text = $line & @lf & 'The above file name is invalid.' Then
		Common_FileWriteLog_1("PASS", $testCaseNumber,$sFileName)
	Else
		Common_FileWriteLog_1("____FAIL,Doublebyte name alert message is incorrect." & $text, $testCaseNumber,$sFileName)
	EndIf
	WinActivate($PMHanlde)   ; Make the focus is on PM.	
	Common_Close_PM()   ; Exit PM.
EndFunc

Func Scan2_6_15()
	Local $testCaseNumber = "2.6.15"   ; The test case number of Thumbnail View STD.
	Common_Del_DB()   ; Delete PM DB.
	ClosePMSBErrorDialog()
	Common_SleepTime(1)
	Local $PMTitle = Common_Run_PageManager()   ; Run PM and get PM title.
	Local $PMHanlde = WinGetHandle($PMTitle)
	ScanSettins($ScanSettingsdialog)
	ScanUIMode($ScanSettingsdialog, "NonUI")
	ScanFrom($ScanSettingsdialog, "Flatbed")
	ScannedFolder($ScanSettingsdialog, "My PageManager")
	SetDocumentType($ScanSettingsdialog, "Magazine (Picture)")	
	SetScanMode($ScanSettingsdialog, "Black and White")
	SetScanSize($ScanSettingsdialog, "A4 210 x 297 mm")
	SetDPI($ScanSettingsdialog, "100  dpi")
	SetSaveAsType($ScanSettingsdialog, "Bitmap(*.bmp)")	
	Common_SleepTime(2)
	ScanProfile($ScanSettingsdialog)	
	SetProfileName($profile,$sPMFolderPath & "ReadonlyFolder")
	ClickSaveButton($profile)
	WinActivate($ScanSettingsdialog)
	Send("{ESC}")
	If FileExists($sPMFolderPath & "ReadonlyFolder.ScnPro") And FileExists($sFilePatch & "Correct.ScnPro") Then
		Local $returnOfCompareFile = Common_CompareFile($sPMFolderPath & "ReadonlyFolder.ScnPro", $sFilePatch & "Correct.ScnPro") 
		If $returnOfCompareFile Then
			Common_FileWriteLog_1("PASS", $testCaseNumber,$sFileName)
		Else
			Common_FileWriteLog_1("____FAIL,The saved profile is incorrect.", $testCaseNumber,$sFileName)
		EndIf
	Else
		Common_FileWriteLog_1("____FAIL,No saved file.", $testCaseNumber,$sFileName)
	EndIf
	WinActivate($PMHanlde)   ; Make the focus is on PM.	
	Common_Close_PM()   ; Exit PM.
EndFunc

Func Scan2_6_25()
	Local $testCaseNumber = "2.6.25"   ; The test case number of Thumbnail View STD.
	Common_Del_DB()   ; Delete PM DB.
	ClosePMSBErrorDialog()
	$file = FileOpen ($DoubleTxt_Path , 0)
	$line = FileReadLine ($file, 1)		
	DirCreate(@MyDocumentsDir & "\" & $line)	
	Local $PMTitle = Common_Run_PageManager()   ; Run PM and get PM title.
	Local $PMHanlde = WinGetHandle($PMTitle)
	ScanSettins($ScanSettingsdialog)
	ScanUIMode($ScanSettingsdialog, "NonUI")
	ScanFrom($ScanSettingsdialog, "Flatbed")
	ScannedFolder($ScanSettingsdialog, "My PageManager")
	SetDocumentType($ScanSettingsdialog, "Magazine (Picture)")	
	SetScanMode($ScanSettingsdialog, "Black and White")
	SetScanSize($ScanSettingsdialog, "A4 210 x 297 mm")
	SetDPI($ScanSettingsdialog, "100  dpi")
	SetSaveAsType($ScanSettingsdialog, "Bitmap(*.bmp)")	
	Common_SleepTime(2)
	ScanProfile($ScanSettingsdialog)	
	SetProfileName($profile,@MyDocumentsDir & "\" & $line & "\Test")
	ClickSaveButton($profile)
	Common_SleepTime(3)	
	If FileExists(@MyDocumentsDir & "\" & $line & "\Test.ScnPro") And FileExists($sFilePatch & "Correct.ScnPro") Then
		Local $returnOfCompareFile = Common_CompareFile(@MyDocumentsDir & "\" & $line & "\Test.ScnPro", $sFilePatch & "Correct.ScnPro") 
		If $returnOfCompareFile Then
			Common_FileWriteLog_1("PASS", $testCaseNumber,$sFileName)
		Else
				Common_FileWriteLog_1("____FAIL,The saved profile is incorrect.", $testCaseNumber,$sFileName)
		EndIf
	Else
		Common_FileWriteLog_1("____FAIL,No saved file in double byte path..", $testCaseNumber,$sFileName)
	EndIf
	WinActivate($ScanSettingsdialog) 
	Send("{ESC}")
	WinActivate($PMHanlde)   ; Make the focus is on PM.	
	Common_Close_PM()   ; Exit PM.
	DirRemove(@MyDocumentsDir & "\" & $line,1)
EndFunc
#ce